<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" @click="handleClick">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
    <button type="primary" @click="handleGo">退出</button>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'HomeView',
  components: {
    HelloWorld
  },
  methods:{
    handleClick(){
      localStorage.setItem("isAuthenticated", 0);
    },
    handleGo() {
      localStorage.setItem('token','') //存储
      this.$router.push('/login');
    }
  }
}
</script>
